using System;
using System.Runtime.Serialization;
using ProtoBuf;

namespace Common
{
    [ProtoContract]
    [DataContract]
    public class TagInfo
    {
        [ProtoMember(1)]
        [DataMember]
        public Guid TagId;

        [ProtoMember(2)]
        [DataMember]
        public string TagName;

        public TagInfo()
        {
        }

        public TagInfo(Guid tagId, string tagName)
        {
            TagId = tagId;
            TagName = tagName;
        }

        public override bool Equals(object obj)
        {
            return TagId.Equals(((TagInfo)obj).TagId);
        }
        
        public static bool operator ==(TagInfo left, TagInfo right)
        {
            return Equals(left, right);
        }

        public static bool operator !=(TagInfo left, TagInfo right)
        {
            return !Equals(left, right);
        }

        public override int GetHashCode()
        {
            return TagId.GetHashCode();
        }
    }
}